import request from '@/utils/request'

//获取采购计划统计
export function labourPlanStateTount() {
  return request({
    url:'/labourPlan/getJobStateCount',
    method: 'get'  
  })
}
//采购计划列表
export function labourPlanList(data) {
    return request({
      url:'/labourPlan/find',
      method: 'post',
      data
    })
}
//创建物资采购计划
export function labourPlanSave(data) {
    return request({
      url:'/labourPlan/create',
      method: 'post',
      data
    })
}
//修改劳务
export function labourPlanEdit(data) {
    return request({
      url:'/labourPlan/savePlanLabourInfo',
      method: 'post',
      isTrue:true,
      data
    })
}
//修改劳务采购计划
export function labourPlanUpdate(data) {
  return request({
    url:'/labourPlan/update',
    method: 'post',
    data
  })
}
//驳回以后  重新发起采购计划  
export function labourPlanApplyAgain(data) {
  return request({
    url:'/labourPlan/applyAgain',
    method: 'post',
    data
  })
}
//劳务批量驳回 
export function labourPlanRejectBatch(data) {
    return request({
      url:`/labourPlan/rejectBatchLabour`,
      method: 'post',
      data
    })
}
//查询驳回劳务
export function getLabourPlanReject(planId) {
    return request({
      url:`/labourPlan/getPlanLabourInfos?planId=${planId}`,
      method: 'get',
    })
}



//批量删除物资采购计划
export function labourPlanDelBatch(ids) {
    return request({
      url:`/labourPlan/delBatch?ids=${ids}`,
      method: 'get'
    })
}
//删除物资采购计划
export function labourPlanDel(id) {
    return request({
      url: `/labourPlan/del/${id}`,
      method: 'post'
    })
}


//根据状态--获取处理人列表
export function labourPlanApplyUser(stateId) {
    return request({
        url:`/labourPlan/getHandleUserListByState?stateId=${stateId}`,
        method: 'get'
    })
}
// 审批明细
export function labourPlanApplyLog(planId) {
    return request({
        url:`/labourPlan/getOpLog?planId=${planId}`,
        method: 'get'
    })
}

//采购计划通过
export function labourPlanSuccess(data) {
    return request({
      url:'/labourPlan/pass',
      method: 'post',
      data
    })
}
//采购计划步骤流转
export function labourPlanReject(data) {
    return request({
      url:'/labourPlan/reject',
      method: 'post',
      data
    })
}

/** ------------------------------------------------------------------------------------------招标发起 */

//待发起列表
export function bidLabourPurchaseList(data) {
  return request({
    url:'/bid/findLabourInfoPager',
    method: 'post',
    data
  })
}
//发起招标
export function bidPurchaseCreate(data) {
  return request({
    url:'/bid/createBid',
    method: 'post',
    data
  })
}

/* ----------------------------------------------------------------------邀请招标 */
export function bidPurchaseCommonList(data) {
  return request({
    url:'/bid/findBidPager',
    method: 'post',
    data
  })
}

//供应商报价
export function bidPurchaseSupplierQuote(data) {
  return request({
    url:'/bid/createQuote',
    method: 'post',
    data
  })
}
//供应商取消报价
export function bidPurchaseSupplierCancelQuote(id) {
  return request({
      url:`/bid/cancelQuote/${id}`,
      method: 'get'
  })
}
//中标公示
export function bidPurchaseOvert(id,gsFlag) {//gsFlag 是否公示  1公示 0不公示 2撤回
  return request({
      url:`/bid/bidPublicity/${id}/${gsFlag}`,
      method: 'get'
  })
}
//终止
export function bidPurchaseStop(id) {
  return request({
      url:`/bid/close/${id}`,
      method: 'get'
  })
}
//详情
export function bidPurchaseDetails(id) {
  return request({
      url:`/bid/detail/${id}`,
      method: 'get'
  })
}
//删除
export function bidPurchaseDel(id) {
  return request({
      url:`/bid/del/${id}`,
      method: 'get'
  })
}

/*-------------------------------------------------邀请采购  */

//供应商报名 专家评分
export function bidPurchaseInvitationSupplierEnroll(data) {
  return request({
    url:'/bid/score',
    method: 'post',
    data
  })
}

//审核通过
export function bidPurchaseInquiryInvitationSetWinSupplier(data) {
  return request({
    url:'/bid/setWinSupplier',
    method: 'post',
    data
  })
}
//询价报名-邀请报名-公告报名明细
export function bidPurchaseInquiryInvitationEnrollDetails(id) {
  return request({
      url:`/bid/getQuoteDetail/${id}`,
      method: 'get'
  })
}
//询价--评审不通过 进入流标
export function bidPurchaseInquiryInvitationCancel(data) {
  return request({
      url:'/bid/cancel',
      method: 'post',
      data
  })
}
//分配专家提交
export function bidPurchaseRoleIdUserSave(data) {
  return request({
      url:'/bid/selectExpertIds',
      method: 'post',
      data
  })
}